#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

//翻转单词顺序列
string ReverseSentence(string str)
{
    reverse(str.begin(), str.end());
    int begin = 0;
    for (int i = 0; i < str.size(); ++i)
    {
        if (str[i] == ' ')
        {
            reverse(str.begin() + begin, str.begin() + i);
            begin = i + 1;
        }
    }
    reverse(str.begin() + begin, str.end());
    return str;
}

void test()
{
}

int main()
{
    test();
    return 0;
}